|
|
|
|
|
|
|
End If
'
' ignore non-native MDB tables
If tblObject.Attributes <> 0 Then
WrCreateTable = ""
Exit Function
End If
'
SQLVBMain.lblProgress = "Creating Tables..."
DoEvents
'
' if it contains spaces, enclose in braces
If InStr(cTable, " ") <> 0 Then
cTable = "[" + cTable + "]"
End If
'
' start SQL line
cTemp = "// Create " + cTable + EOL
cTemp = cTemp + "CREATE TABLE " + cTable + EOL
cTemp = cTemp + Space(INDENT) + "(" + EOL
'
' add each field
For Each objField In tblObject.Fields
cTemp = cTemp + Space(INDENT) + WrCreateField(objField)
cTemp = cTemp + "," + EOL
Next
'
' fix up end of line
If Right(cTemp, Len(EOL) + 1) = "," + EOL Then
cTemp = Left(cTemp, Len(cTemp) - (Len(EOL) + 1)) ' strip last EOL and
comma
End If
cTemp = cTemp + EOL
cTemp = cTemp + Space(INDENT) + ");" + EOL ' add final paren and semi-colon
'
WrCreateTable = cTemp ' return result to caller
End Function |
|
|
|
|
|
|
|
|
Note that the WrCreateTable method skips any tables that start with "MSYS" or that have their attributes set. This eliminates all non-Jet and all Microsoft system tables from the definition set. |
|
|
|
|
|
|
|
|
The WrCreateField and FieldTypeName Methods |
|
|
|
|
|
|
|
|
Now build the WrCreateField routine from Listing A.35. |
|
|
|
|
|